package com.yzs.mvidemo.demo

import android.view.LayoutInflater
import android.view.ViewGroup
import com.chad.library.adapter.base.binder.QuickViewBindingItemBinder
import com.yzs.mvidemo.databinding.ItemViewBinding
import com.yzs.core.test.bean.NewsItem

/**
 *    author : yzs
 *    date   : 2022/1/1211:22
 *    desc   : binding 的形式
 */
class DemoRvAdapter : QuickViewBindingItemBinder<NewsItem, ItemViewBinding>() {

    override fun convert(holder: BinderVBHolder<ItemViewBinding>, item: NewsItem) {
        holder.viewBinding.tvTitle.text = "${item.title}"
    }

    override fun onCreateViewBinding(inflater: LayoutInflater, parent: ViewGroup, viewType: Int): ItemViewBinding {
        return ItemViewBinding.inflate(inflater, parent, false)
    }
}